<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>

<jsp:include page="../../include/top.jsp"/>
<div class="main_body">
    <div class="span9 page_message">
        <section id="contents">
            <ul class="tab-nav nav">
                <li><a href="${BasePath}/order/productType/list?${PublicParams}">产品类型列表<span
                        class="arrow fa fa-sort-up"></span></a></li>
                <li class="current"><a href="">类型添加/修改<span class="arrow fa fa-sort-up"></span></a></li>
            </ul>
            <div class="tab-content">
                <div id="tab1" class="tab-pane in tab1">
                    <!-- 表单 -->
                    <form class="form-horizontal" name="myForm" id="myForm" action="${BasePath}/order/productType/save"
                          method="post">
                        <input type="hidden" name="id" value="${bean.id }"/>
                        <input type="hidden" name="type" value="${type }"/>
                        <input type="hidden" name="itemId" value="${itemId }"/>

                        <div class="form-item cf toggle-name">
                            <label class="item-label">
                                <span class="need_flag">*</span>
                                名称：
                                <span class="check-tips"></span>
                            </label>

                            <div class="controls">
                                <input class="input-xlarge focused" id="name" name="name"
                                       type="text" value="${bean.name }">
                            </div>
                        </div>
                        <button class="btn submit-btn ajax-post" id="submit" type="submit"
                                target-form="form-horizontal"
                                redirect-url="${BasePath}/order/productType/list?${PublicParams}">确 定
                        </button>
                    </form>
                </div>
            </div>
        </section>
    </div>
</div>
    <script type="text/javascript">
        function submitForm() {
            var groupName = $("#groupName").val();
            if (groupName == "") {
                alert("分类名不能为空！");
                return false;
            }
            $("#btn").attr("disabled", "disabled");
            $('#myForm').ajaxSubmit(function (data) {
                if (data.errno == 0) {
                    alert("操作成功！");
                    window.parent.closeModel();
                } else if (data.errno == 1) {
                    $("#alertErr").show();
                    $("#errodesc").html(data.errdesc);
                    $("#btn").removeAttr("disabled");
                }
            });
        }
    </script>
    <jsp:include page="../../include/bottom.jsp"/>
